/**
 * Created by Administrator on 2017/8/23.
 */
var mongoose = require('../db/db');
var Schema = mongoose.Schema;

var UserSchema = new Schema({
  userId: String,
  userName: String,
  userPwd: String,
  orderList: [
    {
      orderId: String,
      orderTotal: Number,
      addressInfo: {
        addressId: String,
        userName: String,
        streetName: String,
        postCode: String,
        tel: String,
        isDefault: Boolean
      },
      goodsList: [
        {
          productId: String,
          productName: String,
          salePrice: Number,
          productImage: String,
          productNum: Number,
          checked: Boolean
        }
      ],
      orderStatus: String,
      createDate: Date
    }
  ],
  cartList: [
    {
      productId: String,
      productName: String,
      salePrice: Number,
      productImage: String,
      productNum: Number,
      checked: Boolean
    }
  ],
  addressList: [
    {
      addressId: String,
      userName: String,
      streetName: String,
      postCode: String,
      tel: String,
      isDefault: Boolean
    }
  ]
});

module.exports = UserSchema;
